﻿Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports NUnit.Framework

Namespace Axial.Tests
    <TestFixture()> _
    Public Class MixedBranchTests
        Inherits TestBase
        <Test()> _
        Public Sub IfInWhileTest()
            Dim check As String = _
"while (a > 1)" & vbNewLine & _
"{" & vbNewLine & _
vbTab & "if (b == 2)" & vbNewLine & _
vbTab & "{" & vbNewLine & _
vbTab & vbTab & "b = 3;" & vbNewLine & _
vbTab & vbTab & "continue;" & vbNewLine & _
vbTab & "}" & vbNewLine & _
vbTab & "b = 4;" & vbNewLine & _
"}"
            check = VerifyMethodOutput("IfInWhile", check)
        End Sub

        Public Sub IfInWhile()
            Dim a As Integer = 1
            Dim b As Integer = 2
            While a > 1
                If b = 2 Then
                    b = 3
                Else
                    b = 4
                End If
            End While
        End Sub

        <Test()> _
        Public Sub WhileInIfTest()
            Dim check As String = "if (a > 1)" & vbNewLine & vbTab & "while (b >= 2)" & vbNewLine & vbTab & vbTab & "b = 1;"
            check = VerifyMethodOutput("WhileInIf", check)
        End Sub

        Public Sub WhileInIf()
            Dim a As Integer = 1
            Dim b As Integer = 2
            If a > 1 Then
                While b >= 2
                    b = 1
                End While
            End If
        End Sub
    End Class
End Namespace